package com.hkbigdata.springbootconfig.bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author liuanbo
 * @creat 2024-09-04-14:44
 * @see 2194550857@qq.com
 */
@Component
//@ConfigurationProperties(prefix = "person")
public class Person1 {
    @Value("${person.name}")
    private String name;
    @Value("${person.age}")
    private int age;
    @Value("true")
    private Boolean boss;
    @Value("2024/1/1")
    private Date birth;
    @Value("#{person.maps}")
    //#{} 没有引号，${} 有引号
    private Map<String,Object> maps;
    @Value("#{person.lists}")
    private List<Object> lists;
    @Value("#{person.dog}")
    private Dog dog;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Boolean getBoss() {
        return boss;
    }

    public void setBoss(Boolean boss) {
        this.boss = boss;
    }

    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }

    public Map<String, Object> getMaps() {
        return maps;
    }

    public void setMaps(Map<String, Object> maps) {
        this.maps = maps;
    }

    public List<Object> getLists() {
        return lists;
    }

    public void setLists(List<Object> lists) {
        this.lists = lists;
    }

    public Dog getDog() {
        return dog;
    }

    public void setDog(Dog dog) {
        this.dog = dog;
    }

    @Override
    public String toString() {
        return "Person1{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", boss=" + boss +
                ", birth=" + birth +
                ", maps=" + maps +
                ", lists=" + lists +
                ", dog=" + dog +
                '}';
    }

    //快捷键alt+insert 生成get set方法 tostring 构造器



}
